%h1.page-title.gl-font-size-h-display
  = _('New merge request')

- if @saml_groups.present?
  = render Pajamas::AlertComponent.new(variant: :warning, dismissible: false) do |c|
    - c.with_body do
      = s_('GroupSAML|Some branches are inaccessible because your SAML session has expired. To access the branches, select the group’s path to reauthenticate.')
    - c.with_actions do
      .gl-display-flex.gl-flex-wrap
        - @saml_groups.each do |group|
          = render Pajamas::ButtonComponent.new(href: sso_group_saml_providers_path(group, { token: group.saml_discovery_token, redirect: project_new_merge_request_branch_from_path(@source_project) }), button_options: { class: "gl-mr-3 gl-mb-3" }) do
            = group.path

= gitlab_ui_form_for [@project, @merge_request], url: project_new_merge_request_path(@project), method: :get, html: { class: "merge-request-form js-requires-input" } do |f|
  - if params[:nav_source].present?
    = hidden_field_tag(:nav_source, params[:nav_source])
  .js-merge-request-new-compare.row{ 'data-source-branch-url': project_new_merge_request_branch_from_path(@source_project), 'data-target-branch-url': project_new_merge_request_branch_to_path(@source_project) }
    .col-lg-6
      .card-new-merge-request
        %h2.gl-font-size-h2
          = _('Source branch')
        #js-source-project-dropdown{ data: { current_project: { value: f.object.source_project_id.to_s, text: f.object.source_project.full_path, refsUrl: refs_project_path(f.object.source_project) }.to_json, current_branch: { value: f.object.source_branch.presence, text: f.object.source_branch.presence }.to_json } }

    .col-lg-6
      .card-new-merge-request
        %h2.gl-font-size-h2
          = _('Target branch')
        #js-target-project-dropdown{ data: { target_projects_path: project_new_merge_request_json_target_projects_path(@project), current_project: { value: f.object.target_project_id.to_s, text: f.object.target_project.full_path, refsUrl: refs_project_path(f.object.target_project) }.to_json, current_branch: { value: f.object.target_branch.presence, text: f.object.target_branch.presence }.to_json } }

  - if @merge_request.errors.any?
    = form_errors(@merge_request)
  .row
    .col-12
      = f.submit _('Compare branches and continue'), data: { qa_selector: 'compare_branches_button' }, pajamas_button: true
